The present invention relates to the field of computer graphics, and in particular to methods and apparatus for realistically rendering and animating water and other particle systems. Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene. Animated sequences can be created by rendering a sequence of images of a scene as the scene is gradually changed over time. A great deal of effort has been devoted to making realistic looking rendered images and animations.
Realistically animating water and other fluids presents a particular challenge. The behavior of a fluid, for example a churning ocean, has a number of different characteristics that are difficult to animate by hand. To assist animators, simulations of fluid dynamics simulations are often used to animate the fluid according to parameters defined by animators. In one type of typical fluid dynamics simulation, the fluid is modeled as a set of particles. The simulation solves a system of equations defining the dynamic behavior of the fluid to determine the motion of the set of particles. The result of the simulation is a set of particles imitating the behaviors of the fluid, such as waves, splashes, eddies, currents and ripples.
Although the set of particles animated by a typical simulation technique move, as a whole, like a fluid, it often does not look like a fluid if rendered directly. Typically, the number of particles in a set is too small to give the appearance of a continuous surface of a fluid. Some rendering techniques render particles as metaballs, which are “blobs” that stretch or deform themselves into a continuous “goo.” However, metaballs give the surface of the fluid a lumpy appearance, similar to rice pudding, which is unacceptable for representing fluids such as water. Other rendering techniques such as marching cubes creates an isosurface from the set of particles. These techniques can creates a smooth, spatially-continuous fluid surface; however, this surface is temporally discontinuous due to frame-to-frame noise. As a results, the motion of the isosurface appears jerky and discontinuous.
Level sets are another way of extracting a spatially and temporally coherent surface from particle systems. A level set defines a surface implicitly, rather than explicitly. A signed distance function is defined for the particle set. The signed distance function specifies the distance from a current location to the nearest point of a surface. The portion of the signed distance function with a value of zero defines the surface of the particle system. In level set applications, the signed distance function is initialized with an initial surface position. A level set differential equation system is then evaluated, for example using numerical techniques, for each frame to update the signed distance function values, and hence the shape and location of the surface.
Although level sets can extract a spatially and temporally coherent surface from particle systems, evaluating the level set equation is computationally expensive and time consuming. For example, a typical level set equation can be a three or four dimensional differential equation.
It is therefore desirable for a system and method to efficiently extract temporally and spatially coherent surfaces from particle systems. It is also desirable for a system and method to be less computationally expensive than level set techniques. It is still further desirable for a system and method to allow for additional rendering effects, such as texture mapping, to be easily added to surfaces extracted from particle systems.